﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Web_Referer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    { 
        Session["key"] = "~/img/Process/1.png";
        if (Session["user"] != null)
        {
            Response.Redirect("Cart.aspx");  
        }
        ButtonConfirm.Visible = false;
    }

    protected void ASPxButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Cart.aspx");
    }

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        
    }
    protected void RadioButtonIndividual_CheckedChanged(object sender, EventArgs e)
    {
        
    }
    protected void ASPxButton1_Click1(object sender, EventArgs e)
    {
        try
        {
            Bestlife.ERP.Entities.E_Referer super = new Bestlife.ERP.Entities.E_Referer();
            super.Super_Distributor1 = ASPxTextBox1.Text;
            string bb = Bestlife.ERP.BusinessRules.B_Referer.refername(super);
            LabelSupDisName.Text = bb;
            if (bb.Equals("Sorry, this does not seem to be a valid Referrer ID."))
            {

                ButtonConfirm.Visible = false;
            }
            else
            {
                ButtonConfirm.Visible = true;
                ButtonConfirm.Enabled = true;
            }
        }
        catch (Exception) 
        {
            Response.Redirect("404.aspx");
        }
    }
}